package com.designPatterns.singleton.client;

import com.designPatterns.singleton.LimitNumberInstance;
import com.designPatterns.singleton.SingletonEnum;
import com.designPatterns.singleton.SingletonInstantLoad;
import com.designPatterns.singleton.SingletonInstantLoadVariant;
import com.designPatterns.singleton.SingletonLazyLoad;
import com.designPatterns.singleton.SingletonLazyLoadDoubleCheck;
import com.designPatterns.singleton.SingletonLazyLoadEnhance;
import com.designPatterns.singleton.SingletonStaticInnerClass;

/**
 * 获取实例的任务
 * Created by houjinxin on 16/3/5.
 */
public class InstanceTask implements Runnable {

    @Override
    public void run() {
//        SingletonInstantLoad instance = SingletonInstantLoad.getInstance();
//        SingletonInstantLoadVariant instance = SingletonInstantLoadVariant.getInstance();//能够创建多个实例,非单例
//          创建了多个实例
//        SingletonLazyLoad instance = SingletonLazyLoad.getInstance();
//        SingletonLazyLoadEnhance instance = SingletonLazyLoadEnhance.getInstance();
//        SingletonLazyLoadDoubleCheck instance = SingletonLazyLoadDoubleCheck.getInstance();
//        SingletonStaticInnerClass instance = SingletonStaticInnerClass.getInstance();
//        SingletonEnum instance = SingletonEnum.INSTANCE;

        LimitNumberInstance instance = LimitNumberInstance.getInstance();
        System.out.println(Thread.currentThread().getName() + instance);
    }
}
